Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix build errors and a crash in xcode 15 #2093

Merged
merged 2 commits into from
Sep 11, 2023

Conversation

cacmartinez
Copy link
Contributor

Fixes build errors when trying to compile with xcode15.

It also fixes a crash happening on XCode15 when attempting to create a new image with either a height or width of 0 or less (UIGraphicsBeginImageContextWithOptions). This can happen when isCancelled returns true.

@CLAassistant
Copy link

CLAassistant commented Sep 8, 2023

CLA assistant check
All committers have signed the CLA.

@cacmartinez cacmartinez marked this pull request as ready for review September 8, 2023 00:41
@@ -121,7 +121,9 @@ NS_INLINE void ASConfigureExtendedRange(UIGraphicsImageRendererFormat *format)
}

// Bad OS or experiment flag. Use UIGraphics* API.
UIGraphicsBeginImageContextWithOptions(size, opaque, scale);
if (size.width > 0 && size.height > 0) {
UIGraphicsBeginImageContextWithOptions(size, opaque, scale);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we have an invalid size, I think we should exit early and return nil. Shortly after starting the image context we call UIGraphicsGetImageFromCurrentImageContext and UIGraphicsEndImageContext. I'm not sure what the behavior is if we end a graphics context without starting one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've switched to an early return

@rcancro rcancro merged commit 923901a into TextureGroup:master Sep 11, 2023
10 checks passed
andrey-golovin-ios added a commit to andrey-golovin-ios/Texture that referenced this pull request Oct 5, 2023
* 'master' of https://github.com/TextureGroup/Texture:
  Fix build errors and a crash in xcode 15 (TextureGroup#2093)
  [ASCellNodeVisibilityEvent] Add a new event when scrolling stops (TextureGroup#2084)
  Trying to get CI to work (TextureGroup#2085)
  fix typo: ASStackLayoutElement.h (TextureGroup#2067)
  Docs: Fix references of ASViewController/ASNavigationController (non-existent) to ASDKViewController/ASDKNavigationController (TextureGroup#2072)
  [ASTextKitRenderer] Adding locking when accessing the text renderer cache (TextureGroup#2075)
  Switch UITextWritingDirection to NSWritingDirection (TextureGroup#2071)
@rahulVermaSimpplr
Copy link

rahulVermaSimpplr commented Jan 17, 2024

Is this code is also available in the released version that is 3.1.0, because we're unable to find it in 3.1.0 release.

@keerthika-priya
Copy link

Is this issue happening only if the app is built using XCode 15?

Danil-Korotaev pushed a commit to youla-dev/Texture that referenced this pull request Jan 19, 2024
…2093)

* Fix build errors and a crash in xcode 15

* early return if 0 or negative dimensions found

Commit: 923901a
nickaroot added a commit to nickaroot/Texture that referenced this pull request Jan 29, 2024
Fix build errors and a crash in xcode 15 (TextureGroup#2093)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants